
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template/LayoutPadrao.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="centro">
        <h:form>
            <p:dataTable value="#{consultaRevisorBean.revisores}" var="revisor" editable="true">
                <p:column style="width: 25px; text-align: center">
                    <f:facet name="header">
                        ID
                    </f:facet>
                    <h:outputText value="#{revisor.cod}"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        Nome
                    </f:facet>                  
                    <p:inplace editor="true">
                        <p:inputText value="#{revisor.nome}"/>
                    </p:inplace>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        Titulação
                    </f:facet>                  
                    <p:inplace editor="true">
                        <p:inputText value="#{revisor.titulacao}"/>
                    </p:inplace>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        Tema
                    </f:facet>                  
                   
                    <h:outputLabel value="#{revisor.temacod.descricao}"/>
                   
                </p:column>
                <p:column style="width: 60px; text-align: center">
                    <p:commandButton id="showDialogButton" icon="ui-icon-close" onclick="msgConf.show()" type="button"/>
                    <p:confirmDialog widgetVar="msgConf" header="Excluir"                             
                              appendToBody="true"                              
                              message="Deseja excluir este revisor?"
                              id="confMesg">
                        
                        <h:commandLink
                            action="#{consultaRevisorBean.exlcuir}"
                            onclick="msgConf.hide();">
                            <f:setPropertyActionListener target="#{consultaRevisorBean.revisorSelecionado}"
                                                         value="#{revisor}"/>
                            <p:graphicImage value="/images/excluir.png" />Sim
                        </h:commandLink>
                        <h:commandLink onclick="msgConf.hide()" 
                                       >
                            <p:graphicImage value="/images/"/>Não
                        </h:commandLink>
                    </p:confirmDialog>
                </p:column>               
            </p:dataTable>
            <p:growl id="messages" />

            <p:messages closable="true"/>
        </h:form>
    </ui:define>

</ui:composition>
